<%@ page import="ar.com.hakasoft.utils.NumberUtil" %>

<div id="items" align="center">
	<table>
        <thead>
            <tr>
            	<th></th>
                <th width="200">Producto</th>
                <th width="80">Fecha</th>
                <th width="80">SubTotal</th>
            </tr>
        </thead>
        <tbody>
	        <g:each in="${listadoEgresos}" status="i" var="egresoInstance">
	            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
	                <td align="left"><img src="${resource(dir:'images',file:'delete.png')}" alt="Eliminar" border="0" onclick="eliminarEgreso('${egresoInstance?.id}');" /></td>
	                <td align="left">${egresoInstance?.producto}</td>
	                <td align="left"><g:formatDate format="dd/MM/yyyy" date="${egresoInstance?.fecha}"/></td>
	                <td align="right" width="120">${NumberUtil.setearDecimales(egresoInstance.total, 2)}</td>
	            </tr>
	        </g:each>
        </tbody>
        <g:if test="${listadoEgresos}">
     		<tr><td colspan="2" align="right" style="font-color: red;"><b>Total</b></td><td align="right"><b>$ ${NumberUtil.setearDecimales(listadoEgresos.total.sum(),2) }</b></td></tr>
    	</g:if>
    </table>
</div>